% online demo
clear;clc

device = 'Neuracle'; % 

channelNumber = 9;   % 8 data channel + 1 trigger channel


IP = '127.0.0.1';    

port = 8712;         % same as datasever's setting

fs = 1000;           % sampling rate

dataLen = 4;         % ringbuffer length(second)

dataserver = DataServer(device, channelNumber, IP, port, fs, dataLen);

dataserver.Open();   % open dataserver

t = 0;

figure
while t < 60
    t = t + 1;
    % get data
    data = dataserver.GetBufferData();
    pause(1);
    plot(data(1,:))
end

dataserver.Close();  % close server



